I find that there are two contradicting factors at play here:
1) On removing proton, negative charge on oxygen is more stable than it is on nitrogen (because of greater electronegativity of oxygen). Therefore, phenol is more acidic than aniline.
2) +M effect of nitrogen is more than oxygen, so negative charge (after deprotonation) in the case of aniline will be more delocalized making the anion more stable. Therefore, aniline should be more acidic than phenol.
So is that a factual question or am I missing something?