If you did a reset on the device, the contacts and photos may well be permanently gone. If you did just a "Factory Reset" and not a "Hard Reset" the info should have stayed on the phone. I would try restarting it to see if they show up. Also, if you had backed them up previously to a google account or other cloud account, you can get them back from there. However, if nothing was backed up before the deletion, then there is no where to get them from. Now if you did the "Hard Reset" that wipes all data and they would be gone.
If restarting doesn't help, try the following. Should this also not help, then they are gone for good.
While there is no guaranty that you can get them back. Deleted does mean deleted. There are a few apps/programs...