Phonon-induced dephasing of localized optical excitations