Its a deterrent. Without it there would have have been far more blood-shed in the previous decades. Doesn't say much for humanity but that's the world we live in.
I dispute that. Increased economic integration and lack of fighting over undeveloped territories (what is referred to as "The Scramble for Africa" in colonial history) have done more to dissuade large scale war in Europe than nuclear weapons. The prospect of another Great War or Second World War with the economic and humanitarian ruin is sufficiently horrifying by itself.
Think through what you're saying: President Hollande of France would not say to himself "well we'll face millions of our people being killed and economic collapse from another war with Germany, but
**** it, there's no nuclear weapons so lets have a go". No, they say "that would be a terrible idea and the days of clashing over who rules Tunisia are done with".
The West's most terrifying bogeyman - China - isn't curtailed by the fact that we have nuclear weapons. They're curtailed by the fact that they did hundreds of billions of dollars of trade with the US and probably close to that with the EU. Oh, and that they own trillions of US debt. They're inextricably interlinked with the West. And in so far as China still engages in military brinksmanship, making advances in the South China Sea, nuclear weapons don't seem to do anything to stop that because they know we wouldn't use them.
Even Russia's games with the Crimean Peninsula or micro-states like South Ossetta, nuclear weapons haven't done one damn thing to stop Russia engaging in such games. Nor is it nuclear weapons that makes Russia decide that starting a large scale war with the entirety of NATO isn't a desirable aim.
Nuclear weapons have not provided us with peace, international trade has. The wars we can look forward to are not wars between equal powers - because the rich in both countries are happy not to ruin their own countries. The wars we can look forward to are ones of rich nations on poorer or vulnerable ones, such as Iraq or Syria.
The ONLY credible instance one can argue of nuclear weapons dissuading war, is the case of North Korea getting hold of them. The fact that North Korea has a probably viable nuke, prevents action against them. You can make that case if you wish. You could also argue that if Iran got hold of nuclear weapons, then Israel would not have risked bombing them some four/five years ago. But that's it and I really, really doubt the protection of N.Korea and Iran was what you had in mind when you claimed that nuclear weapons preserve peace.
We have enjoyed the largest period of international trade in this history of the species over the last fifty years. If you want to look to factors that help stop wars, look there.