Superconductivity of YBa$_2$Cu$_3$O$_{7-delta}$ single crystals was investigated in small magnetic fields. In magnetic measurements the superconducting transition for $textbf{H} | c$ appears 0.4 K higher than for $textbf{H} bot c$. In this temperature range superconductivity is two-dimensional and the total thickness of superconducting layers is about 0.83 of the sample thickness, which is a consequence of the occurrence of the quasi-insulating plane in the unit cell of the crystal structure. Resistivity in the textit{ab}-plane and along the textit{c}-axis was measured simultaneously. In these measurements two-dimensional superconductivity was observed in a temperature range of 0.6-0.8 K with the clear signs of the Berezinskii-Kosterlitz-Touless (BKT) transition which occurs approximately 0.15 K below $T_c$, the mean-field transition temperature.