A molecular-field study on the magnetocaloric effect in Er2Fe17