I have not much guidance to offer, just a few things:
1. take a deep breath. these things happen. don't panic don't stress too much.
2. if the exploit came because of a known issue that has been since patched, then updating your site software (joomla and extensions) will be sufficient after restoring from a backup.
the fact that this happens AFTER
All frontend (public) pages redirect to random websites after about 15 seconds.
then try to search+find files on your server that contain this code.