In the attempt to alleviate the difficulties created by their early formation, we study a model in which supermassive black holes (SMBHs) can grow by the combined action of gas accretion on heavy seeds and mergers of both heavy and light seeds. The former results from the direct collapse of gas in K, H2-free haloes; the latter are the end product of a standard H2-based star formation process. The H2-free condition is attained by exposing haloes to a strong (J21≳ 103) Lyman–Werner ultraviolet (UV) background produced by both accreting BHs and stars, thus establishing a self-regulated growth regime. We find that this condition is met already at z∼ 18 in the highly biased regions in which quasars are born. The key parameter allowing the formation of SMBHs by z= 6–7 is the fraction of haloes that can form heavy seeds: the minimum requirement is that fheavy≳ 0.001; SMBH as large as 2 × 1010 M⊙ can be obtained when fheavy approaches unity. Independently of fheavy, the model produces a high-z stellar bulge–BH mass relation which is steeper than the local one, implying that SMBHs formed before their bulge was in place. The formation of heavy seeds, allowed by the Lyman–Werner radiative feedback in the quasar-forming environment, is crucial to achieve a fast growth of the SMBH by merger events in the early phases of its evolution, i.e. z≳ 7. The UV photon production is largely dominated by stars in galaxies, i.e. BH accretion radiation is subdominant. Interestingly, we find that the final mass of light BHs and of the SMBH in the quasar is roughly equal by z= 6; by the same time, only 19 per cent of the initial baryon content has been converted into stars. The SMBH growth is dominated at all epochs z > 7.2 by mergers (exceeding accretion by a factor of 2–50); at later times, accretion becomes by far the most important growth channel. We finally discuss possible shortcomings of the model.