Barca, who play at Espanyol in La Liga on Jan. 2, will host their Catalan rivals in the Cup first leg on Jan. 6 and the return will be played at Espanyol's Cornella-El Prat stadium a week later.
Third-tier Cadiz, who went through after Real Madrid were expelled for fielding an ineligible player in their last-32 tie, meet Celta Vigo and another city derby will feature Sevilla against Real Betis in an all-Andalusian clash.
Gary Neville's Valencia play Granada, Athletic Bilbao meet Villarreal and Deportivo La Coruna were drawn against second-division Mirandes, who knocked Malaga out in the last 32 and are the only other non-La Liga side left in the competition.
The final last-16 tie pits Las Palmas against Eibar.
(Reporting by Iain Rogers, editing by Ed Osmond)