(abridged) MHD turbulence is known to exist in shearing boxes with either zero or nonzero net magnetic flux. However, the way turbulence survives in the zero-net-flux case is not explained by linear theory and appears as a purely numerical result. Aims: We look for a nonlinear mechanism able to explain the persistence of MHD turbulence in shearing boxes with zero net magnetic flux, and potentially leading to large-scale dynamo action. Method: Spectral nonlinear simulations of the magnetorotational instability are shown to exhibit a large-scale axisymmetric magnetic field, maintained for a few orbits. The generation process of this field is investigated using the results of the simulations and an inhomogeneous linear approach. Results: The mechanism by which turbulence is sustained in zero-net-flux shearing boxes is shown to be related to the existence of a large-scale azimuthal field, surviving for several orbits. In particular, it is shown that MHD turbulence in shearing boxes can be seen as a dynamo process coupled to a magnetorotational-type instability.