First, philosophy can contribute to world peace by helping us think through the ethical importance of peace -- and of war. Philosophy has a long tradition of inquiry into the conditions for morally justifiable violence. A few philosophers have glorified war. Others have argued that war is justified when war advances a state's interests' ('realists') or when certain conditions are met (just war theory). Other philosophers have advocated for pacifism. Good overviews of these positions are available here:
Second, philosophy can contribute to world peace by undermining the conditions under which war tends to thrive and by pointing to alternative ways to resolve conflicts that might otherwise lead to violence. Starry-eyed though this might sound, philosophical inquiry tends to induce, on the one hand, modesty or humility about one's own beliefs, as well, on the other hand, as a greater appreciation for the merits of others' beliefs. Thus, philosophy can serve to defuse, or at least dampen, conflicts arising from clashing worldviews about ethics, religions, etc. Going along with this, philosophy offers us a non-violent model for resolving our disputes: through reasoned argument. Far better in most every case for us to reach a reasoned consensus that avoids war than to march toward an armed conflict.
Of course, philosophy is no magic pill, world peace-wise. But I'm pretty confident that a healthy dose of philosophy could do a lot to diminish the sad human tendency toward intercommunity violence.