Ferroelectric and optical hysteresis in SBN doped with rare-earth elements