In a search for host galaxies associated with quasars, we present results from deep CCD imaging using the European Southern Observatory (ESO) 3.5-m New Technology Telescope (NTT). 21 targets, 12 radio-loud and nine radio-quiet quasars, were observed in R, and additional V and Gunn i images were collected for a subgroup of these. The quasar redshifts are between 0.4 and 0.8, a range largely unexplored in previous studies. At these redshifts the R band corresponds to a rest-frame wavelength between 4600 and 3600 Å. Thus, we are primarily probing the light from young stellar components of the presumed host galaxies. To separate out the light originating from the host object we remove the quasar contribution by scaling the point spread function (PSF). The PSF is a combination of an empirical PSF model, derived from stars lying in the same field as the quasars (used for the core of the PSF), and an analytical model for the wings of the PSF. After PSF subtraction of the QSO image we identify extended residual objects in 17 targets (nine in radio-loud and eight in radio-quiet quasars), of which a few are only marginal detections. These objects are large and luminous and their colours are relatively blue. Their V−R colours are consistent with a stellar population typical of late-type spirals and irregular galaxies. This is true even for the hosts which were best fitted by an elliptical-type luminosity profile. The blue colours could be caused by recent star formation events or by scattering of the QSO light. The luminosity profiles of the hosts in radio-loud quasars are preferentially fitted with elliptical r1/4 models, while the luminosity profiles of the hosts in radio-quiet quasars either are of the elliptical type or are exponential discs. We argue that stars in the host galaxy are the main source of the extended emission. The mean value of the absolute R magnitude is − 22.3 ± 0.2 for the hosts of the radio-loud quasars and − 22.0 ± 0.2 for the hosts of the radio-quiet quasars. In two cases where no extended light source was found, the limiting magnitudes are ≲ − 20.0. Close companion galaxies and signs of tidal forces are found to be a common feature.