You may want to check out Pub 54 and Pub 519 at the irs website. (Sorry I am not allowed to post the links

) It seems your contract is a bit complicated and could do with professional advice. I would look for CPA firms specializing in international tax services (quite hard to come by depending on where you live)
All the best!
saversaba08