First off, when you do a factory reset, you won't have the option to restore data/settings. it wipes the data partition as part of the reset process. Now,messages, you may be out of luck on, unless you were using a messenger that automatically backed them up to your sd card. Your contacts, however, should be in your google dashboard, and if you set the same account as your primary, when you set your phone back up, just manually sync with google in your contacts> accounts and they should come back.