Radiative transfer inside clumpy media: the penetration of UV photons inside molecular clouds