Thermodynamics of interacting magnetic nanoparticles