I have a Mac Mini and it's a great little computer. The main plus is that I can pick my monitor since I don't want a huge glossy monitor, don't like the reflections.
For your use a base Mac mini will probably be the best choice since you don't really need the quad core processor that the iMac comes with.
iMac starts at 1300 and the Mini at 600 + 300 for a decent monitor.
The iMac is self contained so it has a smaller footprint but I mount my Mini on the wall so it doesn't clutter my desk, it can also be mounted behind your desk, that thing is tiny.
You really can't go wrong either way but the Mini will meet your needs very well and the price is better.