Circuit Quantum Electrodynamics in a Magnetic Field