Three-dimensional analysis of multilayered rough surface contact