First of all, make sure to get the Keychain stuff on your machine. On the Provisioning Profile Portal download the WWDR certificate and install it on your machine. Then, get a distribution certificate by going the tab "Distribution". You will have to generate a Certification Request on Keychain and upload it.
The next part is to generate an AppID. To do this, go to the App IDs section and click on the "New app ID" button. Enter the domain for your application(i.e. com.apple.ichat).
Now go to the provisioning section and on the Distribution tab click on New Profile. On the Distribution Method select "App Store". On the profile name enter the name for you profile. Don't forget to select the App ID you've just created and click on "Submit".
Download and install the Provisioning Profile by double clicking on it. On your Xcode project window, expand the targets(it's located on "Groups and Folders"). A property window will open. First go to the Properties tab and on the field identifier enter the domain you entered on your app ID. On the build tab you will see an item called "Configuration", click on it then click on edit configurations. Duplicate the "Release" configuration and name it to "Distribution". Now on the build tab select "Distribution" as the configuration. Type "code sign" on the search field. Expand "Code Signing Identity" and on the first field select "Any iPhone OS Device". On the second field select "iPhone Distribution". Now compile it using this configuration and it will be ready to submit to the App Store.