OK,so I managed to fix it
There are few things you have to do first before using the iCloud from the phone
1)Connect the iPhone.In iTunes,select the summary tab and choose "Backup to iCloud"
2)
If you're using Windows,download this
http://support.apple.com/kb/DL1455
Open it and sign in via your apple ID
-
If you're using OS X,download 10.7.2 update and the iCloud settings should be available in the system preferences.(login with your apple ID)
3)Now go to your iPhone's settings>iCloud>Storage and backup and enable "iCloud backup" and then select "Backup now" and it should work fine without any errors.