World War One, at the very least, was a catalyst for the Russian Revolution. The nessecary direction of production away from farming machinery towards munitions, the conscription of large numbers of Russian workers (leaving up to 1/3 of farms with no workers at all) meant that Russians in the city of Petrograd (now St Petersburg) only had enough food for a few days when the events of February 1917 took place. Indeed the overthrow of the Tsar and the establishment of the provisional government was only because hungry, striking workers joined the protestors and, in a completely unexpected event, forced the Tsar to abdicate. This is what may be termed the economic explanation as to why WW1 contributed to the overthrow of the Tsar.
However it is important to note that in February at least, there is little historical evidence for war being unpopular. Indeed the reason why the Peasants demanded the overthrow of the Tsar was more that he was conducting the war badly than that he was conducting the war at all (his German wife didn't help things), hence why the war continued under the provisional government. It was only after Kerensky's failed "July Offensive" that the war began to be unpopular and the Bolsheviks were able to seize power on a promise of "peace, bread and land". It's important to note that, until February, the only affect war had on the Russian revolution was the above economic explanation, as well as the generally decreased levels of faith in the Tsar. Few mainstream voices in February 1917 were calling for Russian withdrawal from the war.
But some say that WW1 was ultimatley unimportant- and that Russia was such a basketcase that war or no war there would have been a revolution. Figes is one of the key historians who argues this- claiming that Russia in 1914, following signs of obvious social discontent such as the rise in the level of strikes and the Lena Gold Fields massacre, was ripe for revolution and that war, if anything delayed the coming storm by forcing the nation to rally around the troubled Tsar.
However this view is also disputed by historians who argue, no, war really is the key locomotive of this event, and had there not been a war there would have been "peaceful modernisation". Richard Pipes is one of the key advocates of this view.
That's a basic overview of the competing views as to the importance of WW1 in the Russian Revolutions.