TL;DR
If you sign in to the device after the reset with the Google account which had been used for the backup (the primary Google account usually), the contacts which had been backed up will get restored.
Longer version with source:
I'll keep this short and to the point, as most of it has already been discussed here in @RyanConrad's answer, a relevant part of which I shall reproduce here:
(emphasis mine)
Doing a factory reset WILL NOT modify the sdcard in any way. Only the data on the phone will be deleted. Contacts that are set up to sync with your Google account will restore, but everything else will be gone.