The effects of baryons on the halo mass function