  Magnetic field generation in three-dimensional Rayleigh-B\'enard convection
of an electrically conducting fluid is studied numerically by fixing the
Prandtl number at $P=0.3$ and varying the Rayleigh number (Ra) as a control
parameter. A recently reported route to hyperchaos involving quasiperiodic
regimes, crises and chaotic intermittent attractors is followed, and the
critical magnetic Prandtl number ($P_m^c$) for dynamo action is determined as a
function of Ra. A mechanism for the onset of intermittency in the magnetic
energy is described, the most beneficial convective regimes for dynamo action
in this transition to weak turbulence are identified, and the impact of
intermittency on the dependence of $P_m^c$ on Ra is discussed.
