The irradiated uranium dioxide (UO2), which is the nuclear fuel of pressurized water reactors, contains two populations of cavities saturated by fission gaz : i. intergranular cavities almost lenticular in shape whose size ranges between few tens to several hundred nanometers, ii. intragranular cavities, almost spherical in shape whose size is of the order of the nanometer. Recent studies have shown the existence of a surface effect at the scale of nanometric cavities, which influences the effective elastic behavior of the nuclear fuel. In this work, an analytical micromechanical model, which is able to take into account this heterogeneous microstructure and the surface effect at the nanometric scale, is proposed to describe the macroscopic behavior of the irradiated UO2. The approach is based on a multiscale modeling and homogenization techniques in mechanics of materials. The irradiated UO2 is described as a porous media, which contains pressurized spherical nanocavities (intragranular cavities) and randomly oriented pressurized spheroidal cavities (intergranular cavities). The surface effect is taken into account with imperfect coherent interfaces between the matrix and the cavities. A novel model based on the morphologically representative pattern approach has been developed to describe the effective elastic behavior of this heterogeneous medium. The proposed model relies on assumptions whose relevance is evaluated with finite element simulations which require a specific formulation to take into account the imperfect coherent interfaces.