Assuming that you use appropriate cycles and only run the machine when it’s full, the dishwasher wins. This is true even if you include the energy used in the production of the dishwasher in the first place.
To maximize the benefits, choose a model that will last and then look after it. Try to run it fully loaded, use the economy setting when possible and – for maximum green points – use the timer setting to run the dishwasher in the middle of the night. This way you’ll be using the grid at a time of low demand which means the least efficient and dirtiest power stations won’t be running, and as a result, each unit of power will have a slightly lower carbon footprint.
If you have to hand wash, please don’t let the water run.