One possible scenario for the formation of massive black holes (BHs) in the early Universe is from the direct collapse of primordial gas in atomic-cooling dark matter haloes in which the gas is unable to cool efficiently via molecular transitions. We study the formation of such BHs, as well as the accretion of gas on to these objects and the high energy radiation emitted in the accretion process, by carrying out cosmological radiation hydrodynamic simulations. In the absence of radiative feedback, we find an upper limit to the accretion rate on to the central object which forms from the initial collapse of hot (≲104 K) gas of the order of 0.1 M⊙ yr−1. This is high enough for the formation of a supermassive star, the immediate precursor of a BH, with a mass of the order of 105 M⊙. Assuming that a fraction of this mass goes into a BH, we track the subsequent accretion of gas on to the BH self-consistently with the high energy radiation emitted from the accretion disc. Using a ray-tracing algorithm to follow the propagation of ionizing radiation, we model in detail the growth and evolution of the H ii and He iii regions which form around the accreting BH. We find that BHs with masses of the order of 104 M⊙ initially accrete at close to the Eddington limit, but that the accretion rate drops to ∼10−5 M⊙ yr−1 (of the order 1 per cent of the Eddington limit) after ∼106 yr, due to the expansion of the gas near the BH in response to strong photoheating and radiation pressure. One distinctive signature of the accretion of gas on to BHs formed by direct collapse, as opposed to massive Pop III star formation, is an extremely high ratio of the luminosity emitted in He iiλ1640 to that emitted in Hα (or Lyα), i.e. L1640/LHα≥ 2; this nebular emission could be detected by future facilities, such as the James Webb Space Telescope. Finally, we briefly discuss implications for the coevolution of BHs and their host galaxies.