The space weather around the exoplanet GJ 436b: I. The large-scale stellar magnetic field