MHD analysis of the evolution of solar magnetic fields and currents in an active region