We have conducted an optical imaging study aimed at resolving the host galaxies of 79 radio-loud and radio-quiet quasars at z=0.4-0.8, extending the number of investigated objects in this redshift range by ~ 45%. Observations were performed mainly in the R band but also in V and I band using the Nordic Optical Telescope on La Palma. In this paper we discuss the sample composition and observations and the reduction techniques used. The quasars were selected in pairs of radio-loud and radio-quiet objects matched in the z-V plane in order to facilitate a statistical comparison. The radio-loud part of the sample contains comparable numbers of flat and steep radio spectrum sources which also are matched in redshift and V magnitude. Point spread function subtraction was performed using one-dimensional luminosity profiles both on the quasar image and on a field star, and subtracted images and luminosity profiles are shown for each quasar field. The detection rate is 60% for the radio-quiet host galaxies and 80% for radio-loud hosts. The host galaxies have magnitudes which make them brighter than an L* galaxy by a factor of 1.5-4 at the low end of the redshift range, which increases by 2-3 times towards the higher end of the redshift range. Both radio-quiet and radio-loud hosts follow the radio galaxy R-z Hubble relation well. Analysis and discussion of colours and morphology is presented in \citet{orn}. Based on observations made with the Nordic Optical Telescope, operated on the island of La Palma jointly by Denmark, Finland, Iceland, Norway, and Sweden, in the Spanish Observatorio del Roque de los Muchachos of the Instituto de Astrofísica de Canarias.