well there could be a few different answers to this question. first it depends upon the culture in which the particular vampire stories you are drawing upon comes from. Since you are typing in English and alluding to a tradition from recent movies (about vampires that don't just sparkle in sunlight lol) I assume you don't mean Chinese lore so I'll answer this from the perspective of Medieval European background where the more modern concept you refer to is descended from.
Many of the beliefs with regard to how one is supposed to kill a vampire comes from the old beliefs in how to prevent a revenent from rising from its grave and doing nasty stuff to the living
First off no one had a concept of "Ultraviolet" in the Middle Ages and since the tradition of the vampire is folkloric you can only really look at the beliefs from that perspective in the time that these beliefs formed. The vampire myth actually comes from an ancient pre-Christian belief in the existence of what is called a "revenant" which is a dead person who cannot rest due to several possible factors. These include improper burial, having been murdered without justice occurring to the guilty party, being an unbaptized child (in later Christian times), etc.
The revenant is distinguished from a ghost by the fact that it has physical form and in fact one way to discover if a revenent of a recently dead person is responsible is by digging up the suspect corpse and seeing if it has decayed. If the act of rotting has been delayed or it seemed that the hair or fingernails had grown since it was buried it was seen as evidence that this was indeed a revenent.
Usually proper burial rites would then be performed and this would usually supposedly solve the problem. Other measures were pounding a stake through the chest of the corpse to prevent it from being able to get out of its grave. This is where the legend of a stake through the heart to kill a vampire comes from, in fact this was rarely done by itself, often the head was then severed from its body to prevent it from being able to move. other variants include taking the thigh bones of a skeleton and crossing them again over the heart in order to compel the unholy corpse from passing the cross, also depriving it of its legs for mobility (this is the source of the skull and cross bones on pirate ships and as a symbol for poisons). While some of these are of mixed Pagan and Christian origins the point is that the legends associated with a revenent were later to carry over to later vampire legends.
What is important at this point is the understanding that most of these practices also have to do with solar myths and symbolism. The heart is the organ punctured and this along with the head which is often severed are solar symbols, the cross is used and is also a solar symbol.
What is being referenced then is the symbolism of the sun in a spiritual sense, not anything to do with solar radiation or its stellar analogs. In this case the best perspective to take is an astrological one where the stars each radiate an influence, their own power. The vampire isn't being slain by UV rays, but by astrological solar force.
The living world is seen to be the realm of the light and thus the day and sunlight while the night is the world of the moon and the dead (consider the full moon in relation to werewolves in modern folklore as an example with the importance of silver which is associated with the moon in alchemy), thus the sun would be used to turn back the dead to their own realm. All the symbolic actions and practices started in ancient times to push the dead back to where they belong carry over to the modern myths of the vampire quite well.
Looking at the phenomenon from this perspective will I trust clear up some of the confusion. Other stars were seen to have different powers and thus were not appropriate for the job of getting rid of the undead while the symbols of the cross (with its dying and reviving king motif linking it to the solar traditions go back to deep antiquity) and the sun as symbols make a lot more sense in the broader folkloric perspective.
So in a nutshell, it is the sun as a spiritual symbol which does the damage to a vampire, not UV rays.
Hope this is informative and well received,
"Return of the Dead, Ghosts, Ancestors, and the Transparent Veil of the Pagan Mind" by Claude Lecouteux. Also several books by Joseph Campbell, Etc.