Supermassive black holes alter the chemical evolution of galaxies