Changes of the magnetic properties upon hydrogen absorption in rare-earth iron compounds