It depends where you stored your contacts. They could be stored on your phone, on your sim, on your Google account, samsung account, or a mixture of them.
But you CAN back them up using other methods;
If you can access your contacts app you should move them onto one of your accounts, Google or Samsung. This is done through the contacts app itself.
If you can't access the app.
Try going into settings>accounts and backup>back and restore> then choose the "backup data" for your samsung account and make sure contacts are selected. And as an additional precaution, at the bottom of the backup and restore page, it also let's you backup to your sd card, its called "external storage transfer".
