Marriage is considered in law a civil contract to which the consent of the parties capable in law of contracting is necessary.