We present self-consistent global steady state MHD models and synthetic optically thin synchrotron emission maps for the jet of M87. The model consists of two distinct zones: an inner relativistic outflow, which we identify with the observed jet, and an outer cold disk wind. While the former does not self-collimate efficiently due to its high effective inertia, the latter fulfills all the conditions for efficient collimation by the magnetocentrifugal mechanism. Given the right balance between the effective inertia of the inner flow and the collimation efficiency of the outer disk wind, the relativistic flow is magnetically confined into a well-collimated beam and matches the measurements of the opening angle of M87 over several orders of magnitudes in spatial extent. The synthetic synchrotron maps reproduce the morphological structure of the jet of M87, i.e., center bright profiles near the core and limb bright profiles away from the core. At the same time, they also show a local increase of brightness at some distance along the axis associated with a recollimation shock in the MHD model. Its location coincides with the position of the optical knot HST-1. In addition, our best fitting model is consistent with a number of observational constraints such as the magnetic field in the knot HST-1 and the jet-to-counterjet brightness ratio.