Effect of rare-earth doping on the superconducting properties of MgB2