How does a perpetual futures contract affects the price of the underlying? As long as I understand, a futures contract is kind of a prediction for the underlying's price at the time when it expires. But what happens if this futures contract is perpetual, and doesn't have a date where it'll expire? Like bitcoin's futures.

How does buying/selling this contract affects the price now?
(More of a long comment.)

The "futures" in "perpetual futures" found on cryptocurrency exchanges is a bit of a misnomer, as already pointed out. It's not a futures position, but a leveraged spot position. As a result, crypto "perpetual futures" prices typically track spot prices. (There are also bitcoin futures contracts, in the standard sense--- those traded on CME.)

Such positions are not restricted to crptocurrencies. Leveraged spot FX positions are common. The type of exposure is the same whether it's cyptocurrency or central bank currency. More broadly, it's not restricted to currency. Similar instruments exists for equity, etc (but the somewhat unusual vernacular "perpetual futures" is only used in crypto).

In principle, the relationship between spot order flow (leveraged or not leveraged) and price (exchange rate in the case of currency market) is the same in any market. Price equilibriates supply and demand.
(In comparison, the relationship between futures and spot rices derives from spot-forward parity.)

For example, you might buy USD 100 using CNY at 7 CNY/USD exchange rate but only making a deposit CNY 35C for a position with notional value of CNY 700. That's a spot position with 1:50 leverage. This would be a bet on the spot depreciation of CNY.
If CNY depreciates by 1% against USD, the broker credits your margin account by CNY 70. If CNY appreciates, you might get a margin call.

The broker would then hedge his net exposure from aggregate order flow. In the above example, if you were the only customer, the broker would hedge by exchanging USD for CNY in the inter-dealer market. This in turn would drive up CNY against the USD---until the exchange rate equilibriates to where the long USD-short CNY spot bet is no longer profitable. 

Similar mechanism leads to crypto perpetual futures prices tracking spot prices, although price dislocation may occur during episodes of illiquidity.