As we all know, unicorns used to control the sun and moon before Celestia and Luna took over some time after the events of Hearth's Warming Eve, but what do they contribute now?

Compared to Earth ponies and Pegasi, who use their passive magic to control the forces of nature in Equestria, unicorns' racial talent of controlling magic is drastically less useful than it used to be back when they controlled the sun and moon. It can be argued that, although being the near the top of society (at least in Canterlot) the unicorns have nothing to contribute as they can only use basic magic that matches their special talent, meaning that most can only hold items with their powers. Sweetie Belle, for example, would only be able to use her magic to assist with her singing, and not use spells like Twilight Sparkle does.

Ponies listen to Applejack S1E11

Earth ponies- Control nature with their special magical connection with plants and animals. Only they can grow food. Magic is not limited to their special talent.

Noteworthy Pegasus ID S01E16

Pegasi- Control weather and maintain the crops on the ground below with rain using their magical connection. Magic is not limited to their special talent.

Unicorns trying to hold the door closed S02E11

Unicorns- Used to control the sun and moon, but now most can only hold things with their magic and perform minor spells related to their talent.

Maybe it's just me being overly negative about the nature of unicorns. Here's another take. Do unicorns fill any roles?

It is possible that unicorns could collectively move the sun and moon if Celestia and Luna were to be absent after an unfortunate avalanche-related incedent, but this is never stated in the show.

It is shown in Hearth's Warming Eve that unicorns can magically assist in keeping Equestria safe by fighting off evil spirits and other overwelming dangers with their magic. Although most can only perform basic magic, some have huge amounts of power such as Twilight Sparkle, Clover the Clever, Star Swirl the Bearded and Shining Armor.

So unicorns are important to Equestria, just not in a way one might expect.They fill the gap that other breeds cannot, and provide necessary magic when it is needed for the health of Equestria.