Model-based approach for magnetic reconstruction in axisymmetric nuclear fusion machines