A common fixed point theorem for weakly compatible maps