My phone was accidentally factory reset and I want to know if there is a way I can recover my contacts, photos etc.
I don't have any data backed up on my cloud.
A factory reset irrecoverably erases the phone. The data to recover must be backed up on the cloud someplace. Undelete programs exist, however require root and thus voiding the device warranty. Encrypted phones cannot be recovered at all even with root.
I would make sure your phone is signed into all of the previous e-mail, social media, and cloud accounts it was set up with prior to the reset. That will be your best chance of getting anything back.