Use @@IDENTITY
to retrieve latest generated Identity value.
execute it after your insert query.
insert into contactTable ( address, phone) values ('x', 'x')
DECLARE @contactCode INT;
SELECT @contactCode = @@IDENTITY;
update companyTable set company.contactCode = @contactCode Where companyCode=1