I have the same problem with my iPod touch. In settings, go to "General">"Accessibility" and turn AssistiveTouch on. You will have a little square with a circle appear on your screen. tap that to open it up, and there will be a lock screen button. Press and hold this, and just like with the lock button, the "slide to power off" will appear. Good Luck!
Of course now you cannot power it back on as you have no power button... I had the same problem... Just connect the iPhone to your charger and it will power the phone back on.