We study the interaction between a dipolar magnetic field rooted in the central star and the circumstellar accretion disk in a classical T Tauri system. The MHD equations, including radiative energy transport, are solved for an axisymmetric system with a resistive, turbulent gas. A Shakura-Sunyaev-type eddy viscosity and a corresponding eddy magnetic diffusivity are assumed for the disk. The computations cover the disk and its halo in a radial interval from 1.7 to 20 stellar radii. The initial magnetic field configuration is unstable. Because of magnetocentrifugal forces caused by the rotational shear between star and disk, the magnetic field is stretched outward and part of the field lines open. For a solar-mass pre-main-sequence star and an accretion rate of 10-7 Msolar yr-1, a dipolar field of 1 kG (on the stellar surface) is not sufficient to disrupt the disk. The outer, slowly rotating parts of the disk become disconnected, and about 1/10 of the accretion flow is lost because of an outflow at midlatitudes. The critical field strength for the disruption of the disk lies between 1 and 10 kG. Outflows occur at midlatitudes, with mass fluxes of the order of 10% of the accretion rate of the disk. We find solutions in which the magnetic field tends to spin down the stellar rotation without disk disruption, but in these cases the accretion torque is dominant, and the star is still spun-up.