Miley did the voiceover for Bolt and wrote the song that was up for Best Song. Beyonce was there to perform.
No, she didn't. Three songs were nominated--two from Slumdog and one from Wall-E, which was written by Peter Gabriel. There was a studio push to get a nom for the Bolt song, but it didn't work.
The real reason Miley was there is that she's a Disney star and the Oscars were an ABC-Disney extravaganza. I was amused to see that the post-Oscars Barbara Walters special kicked off with an interview of the Jonas Brothers, who had zero to do with the Oscars but who are also Disney stars.
Synergy, baby.