Ab initiostudy of Schottky barriers at metal-nanotube contacts