Magnetars as cooling neutron stars with internal heating