The Spanish side finished third in Champions League Group H, behind Juventus and Manchester United, while Brendan Rodgers' men were runners-up to Salzburg in Europa League Group B.
Celtic are scheduled to be at home in the first leg with the return match a week later.
Ties are due to be played on February 14/21 but fixtures have yet to be confirmed by UEFA.