That is called an Anonymous Function and is only supported in later versions of PHP, specifically 5.3.0 and later. If I were a betting man I would say your server has an earlier version of PHP. Try this instead:
/*Add meta boxes to contact page*/
function contact_metaboxes( \WP_Post $post ) {
global $post;
if( ! empty( $post ) ) {
$pageTemplate = get_post_meta($post->ID, '_wp_page_template', true);
if($pageTemplate == 'page-contact.php' ){
add_meta_box( 'contact_meta_1', 'Contact Details', 'contact_details', 'page', 'normal', 'high' );
add_meta_box( 'contact_meta_2', 'Social Details', 'social_details', 'page', 'normal', 'high' );
add_meta_box( 'contact_meta_3', 'Footer Details', 'footer_section', 'page', 'normal', 'high' );
add_meta_box( 'contact_meta_4', 'Copyright', 'copyright', 'page', 'normal', 'high' );
}
}
}
add_action( 'add_meta_boxes_page', 'contact_metaboxes', 1 );