At any time before marriage, the parties may make a written contract providing that, after the marriage is solemnized, the whole or any designated part of the real or personal property or any right of action, of which either party may be seized or possessed at the time of the marriage, shall remain or become the property of the husband or wife, according to the terms of the contract. Such contract may limit to the husband or wife an estate in fee or for life in the whole or any part of the property, and may designate any other lawful limitations. All such limitations shall take effect at the time of the marriage in like manner as if they had been contained in a deed conveying the property limited.