When you place it inside the header and the header contains the run at server then you can not use this with out pass from the header filter that also change that part that you have the issue.
To by pass it use a literal control and fully render it on code behind, eg as:
<asp:Literal runat="server" id="txtScriptOnheader" EnableViewState="false" />
and on code behind:
txtScriptOnheader.Text = "<link href=\"/Styles/Themes/\"" + ThemeName + "/jquery-ui-1.9.2.custom.css\" rel="stylesheet\" type=\"text/css\" />";