The radio luminosity function of cluster radio halos