The most efficient way of generating particles for Monte Carlo (MC) dose calculation is through a virtual source model (VSM) of the linear accelerator head. We have previously developed a VSM based on three sources: a primary photon source, a secondary photon source and an electron contamination source (Sikora et al 2007). In this work, we present an improvement of the electron contamination source. The VSM of contamination electrons (eVSM) is derived from a full MC simulation of the accelerator head with the BEAMnrc MC system. It comprises a Gaussian source located at the base of the flattening filter. The eVSM models two effects: an energy-dependent source diameter and an angular dependence of the particle fluence. The air scatter of the contamination electrons is approximated by energetic properties of the eVSM so that explicit in-air transport is not required during MC simulation of the dose distributions in the patient. The calculations of electron dose distributions were compared between the eVSM and the full MC simulation. Good agreement was achieved for various rectangular field sizes as well as for complex conformal segment shapes for the contamination electrons of 6 and 15 MV beams. The 3D dose evaluation of the surface dose in a CT-based patient geometry shows high accuracy (2%/2 mm) of the eVSM for both energies. The model has one tunable parameter, the mean energy of the spectrum at the patient surface. High accuracy and efficiency of particle generation make the eVSM a valuable virtual source of contamination electrons for MC treatment planning systems.