The quotes are only special characters that need to be escaped if either (a) they are the character used to quote the entire string or (b) they are used as the regex delimiter. (I much prefer to use about anything other than a quote as the delimiter, as that's just too confusing!)
You can use a character class along with a sub-pattern reference something like:
$content = preg_replace('#(href\s*=\s*[\'"])http://domainname.com/#is', "$1/", $content);