You should be able to access the controller property in JavaScript that is directly in your page, such as:
var url = "{!contractURL}";
The Visualforce engine will substitute in all of the values when generating the page.
If you are updating that value in your controller as part of an ajax call (e.g., command button with reRender) it won't update the value of the JavaScript value since that part of the page was already generated.
In a part that you are reRendering you could set the value of the variable, or probably better, create a dedicated outputPanel to set it.
<apex:outputPanel id="reRenderedPanelToSetVariable">
<script type="text/javascript">
url = "{!contractURL}";
</script>
</apex:outputPanel>
Then from your command button or whatever you just include the "reRenderedPanelToSetVariable" in the list of ids to rerender.