You’ll want to use the get_permalink
function like so:
<a href="https://wordpress.stackexchange.com/questions/63017/<?php echo get_permalink(get_page_by_path("contact')); ?>">Contact</a>
Which will return the correct URL no matter what your permalink settings are.