Rare-earth magnetism in cuprates