Static plasma confinement by harmonic magnetic fields