Robby has a fine article on the steps you need to take to impersonate an account within your Web part code.