Nuclear obscuration in active galactic nuclei