what CMS have you used? If you have taken backup, it shouldn't be a problem. You may also contact your host, and ask them install the backup.
The easiest way of handling it is if you wipe out the whole thing and do a fresh install. Have you taken a backup?
Ask host to update all server software (apache, MYSQL, PHP) to latest version. Delete all joomla files in html root folder, change all passwords (including root), restore from back up, patch to latest version. But then again, your using joomla, what do you expect?
Also make sure your joomla admin folder domain.com/adminstrator is password protected via Cpanel > Password Protect Directories for an extra layer of protection. Most of all, make sure your cpanel password is very long. And make sure you don't edit from a public place like a school, library or a cyber cafe.
This looks like a Joomla exploit. I highly suggest you reinstall and update. Also, consider following up with one of my free security assessments. The signature I'm using is linked.