Organometal trihalide perovskite solar cells have been rapidly developed and attracted much attention in recent years due to their high photoelectric conversion efficiency and low cost. Pulsed laser deposition (PLD) is a widely adopted technology which is used in the preparation of thin films, especially oxide thin films. With this technology, the thickness and composition of films can be conveniently and accurately controlled. In the structure of perovskite solar cells, TiO$_2$ layer working as the n-type semiconductor is used to block holes and transport electrons into electrode, which is crucial for the performance of whole devices. We introduced the PLD technique into preparation of TiO$_2$ layer. In comparison with common spin coating method, TiO$_2$ layer prepared by this technique is ultrathin and more compact. Compact TiO$_2$ (c-TiO$_2$) layers with optimized thickness of 32 nm have been prepared by the PLD method and the highest efficiency of 13.95 % for the MAPbI$_3$-based solar cell devices has been achieved.