The dust covering factor in active galactic nuclei