UV filters are primarily used to protect the camera lens. They are clear and do not affect the image. With film cameras, however, they can actually reduce haze and improve contrast because they limit the amount of UV light that reaches the film. UV light may not be visible to the human eye but on a hazy day, it will reduce film contrast. For digital photographers, this isn't much of an issue because a digital camera sensor is not as sensitive to UV light as film.
If you opt to use the filter on a digital camera, for protection purposes, be aware that they have the potential to decrease image quality because they increase lens flare. The filter will either reduce contrast or add a slight color tint. To combat this potential problem, choose a multi-coated UV filter and keep the filter very clean. And of course, pick high quality brands.
There is often debate whether photographers need the filter for protection, considering the potential degradation of image quality. Often those with rather expensive SLR lenses use one because it's cheaper to replace a filter than a lens. Personal preference ends up being the determining factor for people with less expensive lenses.