Rare-earth impurities in gallium nitride: The role of the Hubbard potential