Magnetic fields and the solar corona