This paper discusses how the quenching of the magnetic diffusivity by a magnetic field can lead self-consistently to a realistic scenario for dynamo action at the base of the solar convection zone. An αω dynamo model is developed to test Parker's hypothesis that quenching the diffusivity inversely with the magnetic energy in a nonlinear dynamo model leads to the restriction of the field to a thin layer at an interface between a layer of shear (ω-effect) and cyclonic turbulence (α-effect). As the dynamo number is increased, solutions jump discontinuously from a branch of "weak-field" solutions to another where strong magnetic field is generated in a layer of reduced diffusivity. Hysteresis between these two solutions is observed, and this is then explained by deriving a simpler model using physical arguments. This model predicts the occurrence of a cusp catastrophe which may be found in the partial differential equations. The results are relevant to a solar dynamo acting at the base of the convection zone and may give an insight into the mechanism leading to the appearance of grand minima in solar activity.