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