  We determine the free energy of strongly interacting matter as a function of
an applied constant and uniform magnetic field. We consider N_f = 2+1 QCD with
physical quark masses, discretized on a lattice by stout improved staggered
fermions and a tree level improved Symanzik pure gauge action, and explore
three different lattice spacings. For magnetic fields of the order of those
produced in non-central heavy ion collisions (eB ~ 0.1 GeV^2) strongly
interacting matter behaves like a medium with a linear response, and is
paramagnetic both above and below the deconfinement transition, with a
susceptibility which steeply rises in the deconfined phase. We compute the
equation of state, showing that the relative increase in the pressure due to
the magnetic field gets larger around the transition, and of the order of 10 %
for eB ~ 0.1 GeV^2.
