We propose a scenario for the formation of the main belt in which asteroids incorporated icy particles formed in the outer solar nebula. We calculate the composition of icy planetesimals formed beyond a heliocentric distance of 5 au in the nebula by assuming that the abundances of all elements, in particular that of oxygen, are solar. As a result, we show that ices formed in the outer solar nebula are composed of a mix of clathrate hydrates, hydrates formed above 50 K and pure condensates produced at lower temperatures. We then consider the inward migration of solids initially produced in the outer solar nebula and show that a significant fraction may have drifted to the current position of the main belt without encountering temperature and pressure conditions high enough to vaporize the ices they contain. We propose that, through the detection and identification of initially buried ices revealed by recent impacts on the surfaces of asteroids, it could be possible to infer the thermodynamic conditions that were present within the solar nebula during the accretion of these bodies, and during the inward migration of icy planetesimals. We also investigate the potential influence that the incorporation of ices in asteroids may have on their porosities and densities. In particular, we show how the presence of ices reduces the value of the bulk density of a given body, and consequently modifies its macroporosity from that which would be expected from a given taxonomic typ