Planck has mapped the polarized dust emission over the whole sky, making it possible to trace the Galactic magnetic field structure that pervades the interstellar medium (ISM). We combine polarization data from Planck with rotation measure (RM) observations towards a massive star-forming region, the Rosette Nebula in the Monoceros molecular cloud, to study its magnetic field structure and the impact of an expanding HII region on the morphology of the field. We derive an analytical solution for the magnetic field, assumed to evolve from an initially uniform configuration following the expansion of ionized gas and the formation of a shell of swept-up ISM. From the RM data we estimate a mean value of the line-of-sight component of the magnetic field of about 3microG (towards the observer) in the Rosette Nebula, for a uniform electron density of about 12cm-3. The dust shell that surrounds the Rosette HII region is clearly observed in the Planck intensity map at 353 GHz, with a polarization signal significantly different from that of the local background when considered as a whole. The Planck observations constrain the plane-of-the-sky orientation of the magnetic field in the Rosettes parent molecular cloud to be mostly aligned with the large-scale field along the Galactic plane. The Planck data are compared with the analytical model, which predicts the mean polarization properties of a spherical and uniform dust shell for a given orientation of the field. This comparison leads to an upper limit of about 45degr on the angle between the line of sight and the magnetic field in the Rosette complex, for an assumed intrinsic dust polarization fraction of 4%. This field direction can reproduce the RM values detected in the ionized region if the magnetic field strength in the Monoceros molecular cloud is in the range 6.5--9microG.