Correlated basis theory of nucleon optical potential in nuclear matter