This paper presents measurements of D∗± production in deep inelastic scattering from collisions between 27.5 GeV positrons and 820 GeV protons. The data have been taken with the ZEUS detector at HERA. The decay channel D∗+ → (D0 → K−π+)π+ (+c.c) has been used in the study. The e+p cross section for inclusive D∗± production with 5 < 2 < 100 GeV2> and y < 0.7 is 5.3 ± 1.0 ± 0.8 nb in the kinematic region and |η(D∗±)| < 1.5. Differential cross sections as functions of , η(D∗±), W and 2 are compared with next-to-leading order QCD calculations based on the photon-gluon fusion production mechanism. After an extrapolation of the cross section to the full kinematic region in and η(D∗±), the charm contribution F2cc̄(x, 2) to the proton structure function is determined for Bjorken x between 2 · 10−4 and 5 · 10−3.