  Gravitational wave production induces a strong constraint on the amplitude of
a primordial magnetic field. It has been shown that the nucleosynthesis bound
for a stochastic gravitational wave background implies that causally generated
fields cannot have enough power on large scales to provide the seeds necessary
for the observed magnetic fields in galaxies and clusters, even by the most
optimistic dynamo amplification. Magnetic fields generated at inflation can
have high enough amplitude only if their spectrum is very red. Here we show
that helicity, which leads to an inverse cascade, can mitigate these limits. In
particular, we find that helical fields generated at the QCD phase transition
or at inflation with red spectrum are possible seeds for the dynamo. Helical
fields generated at the electroweak phase transition are instead excluded as
seeds at large scales. We also calculate the spectrum of gravitational waves
generated by helical magnetic fields.
