The dispersion in the Cepheid period–luminosity relation and the consequences for the extragalactic distance scale