Self-shielding of hydrogen in the IGM during the epoch of reionization