If you are using Google Chrome (I don't think there is a better browser than that out there. If you haven't tried it yet, go download it here. And go to the extensions gallery. It is like addons for Firefox and install the StayFocusd extension here.
With this you can set the add the sites which you think you waste most of your time on or on which you can't close the browser on, add those to the blocked sites list in this. And it will do the rest. You can have a ten minutes of time or configurable amount of time where all the sites in the list will be available. After that they will be blocked. You may worry that even in the evening or during the time away from work also these sites will remain blocked. There is a solution for that also. Here are the options available
You can set various options like active days (to exclude weekends), active hours, daily reset time, allowed sites and even nuclear option - in which you can just specify which sites to allow. It will block everything else. Smart people might think that they can just increase the time when the feel that time is getting completed for the day. But they have factored such things also, the changes don't take effect till the next day. So you are completely blocked.
Ofcourse you can close the browser and open another browser like IE or firefox but after using chrome, I am not liking to use chrome.
Other cool extensions:
Other cool extensions which have made my life easier are Awesome Screenshot which helps you to capture screenshots and annotate them and IE Tab. IE Tab is very useful to open some sites which are still in the dark ages and open properly only in IE. Actually we could boycott them but not using outlook web access if you work in an IT company is not possible. So IE Tab has finally blocked the final reason which I used to open IE. If you use an android phone, and you thought typing something on the url bar of phone browser is a pain, we have LinkPush extension which just pushes the link from your chrome browser to your phone. Amazing I say.