Cosmic reionization of hydrogen and helium: contribution from both mini-quasars and stars