We use cellular dynamical mean-field theory with extended unit cells to study the ground state of the two-dimensional repulsive Hubbard model at finite doping. We calculate the energy of states with d-wave superconductivity coexisting with spatially uniform magnetic order and find that they are energetically favoured in a large doping region as compared to the uniform solution. We study the spatial form of the superconducting and magnetic order parameters at different doping values.