Only 1 quotation mark is required at the end of the string, after 'nofollow', not two.
Single quotes are being used to seperate the HTML from the code
Code:
'<a href="' + URL + '" rel="nofollow">'
means
Code:
Generate this on the page, please <a href="addurlhere" rel="nofollow">