Lensing model of MACS J1149.5+2223 – I. Cluster mass reconstruction