Impact of dark matter decays and annihilations on reionization