Yes, it will be valid. In order to conclude a lease agreement, it is not necessary to register it anywhere, and therefore to contact the authorities of Ukraine. The contract is concluded in writing between the lessor and the lessee.
Perhaps this information will be useful for you, that in accordance with part 6 of Article 762 of the Civil Code of Ukraine, the tenant is exempt from rent for the entire time during which he could not use the rented property due to circumstances for which he is not responsible.