I just did a search in the market for ya. There's a app called "power off" by tice. It looks like you need to be rooted for it to work and after reading the comments it looks like people have it working while others say they can't get it to work.
I don't know any thing regarding rooting a Android phone at the moment. Also the app is .99 cents usd.
There is an app called profiles from iamjosh. While it doesn't turn off the phone, it will change your sound settings at selected times. So you could set it to go completely silent overnight, but not shut off.