Production and escape of hydrogen on Mars