Molecular dynamics simulations of water and nitrogen confined in a model amphiphilic nanotube were performed. The nanotube has a diameter of 4 nm and consists of hydrophobic atoms and regularly placed OH groups. The results show that the density of water close to the nanotube walls is lower compared to the density in the center of the nanotube. The hydrogen bonded network of water molecules is practically intact compared with the bulk water. The simulation confirms that the experimentally observed low formal density of water in the nanopores (0.88 g/cm3) is due to formation of small unfilled cavities adjacent to the pore walls. Nitrogen molecules are localized primarily in the unhydrated cavities. The presence of nitrogen molecules is not the main reason for the decrease of water density in the nanotube.