This is possible using the AJAX Toolkit, which you can invoke on button click.
Here is a create example
var account = new sforce.SObject("Account");
account.Name = "my new account";
var result = sforce.connection.create([account]);
After creating the Opportunity, you can update the Lookup on the Service Contract with the OpportunityId.
Equally, you can do it in a trigger (perhaps after insert), where it happens more seamlessly and unless there is reason to give the user some kind of immediate visual feedback via the button click, I would prefer the trigger over embedding Javascript on the button click.
P.S. There is also the option of doing your processing in an Apex class webservice method and invoking that on button click.
Use the synchronous update example from the AJAX Toolkit reference
var account = new sforce.SObject("Account");
account.Name = "myName";
account.Phone = "2837484894";
result = sforce.connection.create([account]);
//update that account
account.id = result[0].id;
account.Phone = "12398238";
result = sforce.connection.update([account]);