Measurement of the X(3872) production cross section via decays to J/psi pi+ pi- in pp collisions at sqrt(s) = 7 TeV