  Dense gas in the centre of galaxies feeds massive black holes, but can also
become a source of obscuration and limit our ability to find faint Active
Galactic Nuclei (AGN). We use a high resolution cosmological radiative
hydrodynamics simulation to connect the properties of the gas in the central
region (a few tens of parsecs) of a high redshift galaxy to the growth of a
massive black hole during the first billion years of the Universe. We find that
the feedback from the AGN efficiently controls the growth of the black hole and
limits the duration of the high accretion episodes by emptying the gas
reservoir. As the galaxy grows in mass, the production of metals results in the
presence of dust-enriched gas in the galaxy centre that can obscure highly
accreting black holes enough to strongly reduce their UV/optical visibility. We
also find that the gas outside the very centre of the galaxy can contribute to
the total column density and obscuration at a level at least comparable to the
gas in the nuclear region. We suggest that this explains the different duty
cycles required to explain the masses of high redshift quasars and the observed
UV/optical luminosity functions: in our case, the AGN would be observed with an
X-ray luminosity above $L_X = 10^{42}$ erg/s around 30% of the time, but with
UV magnitude brighter than $M_{1450}$ = -23 only 4% of the time.
