The law of contract does not at any time say that any contract executed with a woman or a man after 8 pm at night is not valid. In fact there is no time boundation for executing a contract. Further we cannot discriminate on the ground of caste, creed, religion, s*x etc.
Therefore, the answer to your question is "yes" the contract is very much valid
hope you have a satisfactory reply