Influence of impurities on the properties of rare-earth-doped barium-titanate ceramics