Usually, the Contact header field in the Invite request is useless. For example, the UAC and the UAS are in different LANs. The Contact field may be:
INVITE sip:bob@sipprovider SIP/2.0
Contact: Alice<alice@192.168.1.10>
.....
There is no use of the Contact field while we can still build a dialog. Then, why the Contact header field is mandatory?
The contact field contains the address at which the callee can reach the caller for future requests. For example, it's necessary so that the callee can send a BYE or a re-INVITE to the caller.
The Contact header says where you are (or rather, where your User Agent is), while the From header says who you are.
You might have several SIP devices all registered to the same Address of Record (the URI you put in the From header).
Further, REGISTER requests use Contact headers to maintain SIP's location service: they let a user agent update a registrar's location information.
(As an aside, if Alice calls Bob, the Contact header needs to be in a 2xx response so that Alice can route the 2xx's ACK to Bob. This points to DarkDust's comment about some SIP proxies mangling Contact headers: if it doesn't, you find yourself in the uncomfortable position of having a call that's only half established: Alice thinks the call's set up because she sent her ACK, but Bob never receives it. An alternative to a Contact-mangling Proxy is using a B2BUA as a network gateway; it wouldn't need to mangle the Contact header because the header would point to the B2BUA itself.)
In response to Phoenix Luo's comments, because of the shortcomings of using LAN IPs in a Contact header, RFC 5627 describes a solution - using globally routable user agent URIs
(GRUUs) in the Contact header/s.