Mouse/Keyboard won't connect after being powered off my iMac has recently developed an odd issue:

If the mouse, or keyboard, is powered off (power button, or because I pull the batteries), and then powered on again, the device will not connect to the machine again without the whole system being power cycled.

These are:
* Magic Mouse
* Apple Wireless keyboard

On a late 2009 i7 27" imac.

Running all the latest patches.
100% battery on both devices.
No matter how many times I click the mouse, or press keys on the keyboard will it reconnect.

It had happened previously, but after a few minutes it would usually resolve itself. In the past 3 days, it's started happening even without the device being powered off -- specifically the mouse stops working, and a power cycle fixes it.

Note that plugging in another mouse/kb (microsoft ones), works fine and I can use that to shut down the machine.
Try configuring Bluetooth Preferences so that Bluetooth status shows in the menu bar.  Then you can then toggle Bluetooth Off and toggle it back On again from the menu bar after you turn on any Bluetooth accessory that doesn't connect right away for some reason.  You shouldn't need to reboot your Mac.