We assess the risk of an Earth impact for asteroid (99942) Apophis by means of a statistical analysis accounting for the uncertainty of both the orbital solution and the Yarkovsky effect. We select those observations with either rigorous uncertainty information provided by the observer or a high established accuracy. For the Yarkovsky effect we perform a Monte Carlo simulation that fully accounts for the uncertainty in the physical characterization, especially for the unknown spin orientation. By mapping the uncertainty information onto the 2029 b-plane and identifying the keyholes corresponding to subsequent impacts we assess the impact risk for future encounters. In particular, we find an impact probability greater than 10^-6 for an impact in 2068. We analyze the stability of the impact probability with respect to the assumptions on Apophis physical characterization and consider the possible effect of the early 2013 radar apparition.