  In the absence of an active dynamo, purely poloidal magnetic field
configurations are unstable to large-scale dynamical perturbations, and decay
via reconnection on an Alfvenic timescale. Nevertheless, a number of classes of
dynamo-free stars do exhibit significant, long-lived, surface magnetic fields.
Numerical simulations suggest that the large-scale poloidal field in these
systems is stabilized by a toroidal component of the field in the stellar
interior. Using the principle of conservation of total helicity, we develop a
variational principle for computing the structure of the magnetic field inside
a conducting sphere surrounded by an insulating vacuum. We show that, for a
fixed total helicity, the minimum energy state corresponds to a force-free
configuration. We find a simple class of axisymmetric solutions, parametrized
by angular and radial quantum numbers. However, these solutions have a
discontinuity in the toroidal magnetic field at the stellar surface which will
exert a toroidal stress on the surface of the star. We then describe two other
classes of solutions, the standard spheromak solutions and ones with fixed
surface magnetic fields, the latter being relevant for neutron stars with rigid
crusts. We discuss the implications of our results for the structure of neutron
star magnetic fields, the decay of fields, and the origin of variability and
outbursts in magnetars.
