function the_slug_exists($post_name) {
    global $wpdb;
    if($wpdb->get_row("SELECT post_name FROM wp_posts WHERE post_name = '" . $post_name . "'", 'ARRAY_A')) {
        return true;
    } else {
        return false;
    }
}

usage:

If you wanted to check for say a page with a slug 'contact' you could use:

if(the_slug__exists('contact') { }