The effect of minihaloes on cosmic reionization