Rare-earth aggregates in sol-gel silica and their influence on optical properties