pKa_1 = 6.3
pKa_2 = 10.3
pKa = 7.1
When you add p-nitrophenol and NaHCO_3 you have to decide between p-nitrophenol and HCO3^- as to which one will act as acid.
For HCO3^- to act as an acid the pKa = 10.3 and for p-nitrophenol to act as an acid pKa = 7.1
Lower the pKa, stronger the acid.
Hence p nitrophenol will act as an acid giving you:
NO_2-Ph- OH + HCO_3^- \rightleftharpoons NO_2-Ph-O^- + H_2CO_3
H_2CO_3 \leftrightharpoons CO_2 + H_2O