Confinement of quarks in nuclear matter