It is designed to block UV light, i.e. light with a shorter wavelength than blue/violet, and which is invisible to the human eye. If too much UV light gets to the film or digital sensor, it can result in a blue color cast, although though with digital cameras and automatic white balance, you'd probably never notice it.
So, if you have a DSLR do you really need to block UV? In most cases, probably not. The glass and optical cement used in camera lenses don't transmit well in the UV, and unless you are high on a mountain, atmospheric absorption reduces UV light to a fairly low level anyway. However, UV filters do serve another purpose, even when there is no UV light to block. Since they are colorless, they don't affect the visible light image and they can protect the front element of a lens from physical damage.
As with any filter, buying the highest quality multicoated version that you can afford makes sense. Uncoated or monocoated filters can increase flare and reduce image contrastand poorly made filters can lower image resolution, so it's false economy to put a $10 filter on a $500 lens (but a $30-50 multicoated filter such as the Hoya Skylight Super Multi Coated might make sense).
There's filters, and there's filters: Shot at left was taken through a high-quality, multicoated filters. A low-cost, uncoated filter produced noticeable flare, right. Moral? It's worth paying more for multicoating!