A Russian submarine was deployed alongside a spy ship to map critical undersea infrastructure around Britain, it has emerged.