Praise be to Allah.
You have to cut your hair now, but you do not have to do anything else. The scholars of the Standing Committee for Issuing Fatwas were asked about a woman who did Hajj and did all the actions of Hajj, except that she did not cur her hair until now, out of ignorance or forgetfulness. She has reached her homeland and she is asking what she has to do.
They replied: If the matter is as the questioner has described, that she did everything except cutting her hair, either out of forgetfulness or ignorance, then she has to cut her hair in her homeland, and she does not have to do anything else due to her delaying it because of ignorance or forgetfulness, with the intention of completing her Hajj. We ask Allaah to help and accept the deeds of all. End quote.
Fataawa Islamiyyah (2/264).
As for the marriage contract, it is valid, because if the pilgrim does all the rituals but omits to shave his head, then it becomes permissible for him to do all the things that are forbidden whilst in ihraam (which includes getting married), except intercourse.
And Allaah knows best.