CTRL- or RIGHT-click on the Safari icon in the Dock. Select the Force Quit option. If that doesn't work open Activity Monitor (/Applications/Utilities/ folder) and locate the Safari process in the process listing. Select it then click on the Quit icon in the toolbar and click, again, on the Force Quit button.
If none of the above works then press the power button down and hold it down for about 6-8 seconds until the computer shuts down. Now before you try restarting do the following:
Repair the Hard Drive
Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported, then quit DU and return to the installer. Quit the installer to restart the computer.
If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.