Let Ω be a convex polytope in Rd. We say that Ω is spectral if the space L2(Ω) admits an orthogonal basis consisting of exponential functions. There is a conjecture, which goes back to Fuglede (1974), that Ω is spectral if and only if it can tile the space by translations. It is known that if Ω tiles then it is spectral, but the converse was proved only in dimension d=2, by Iosevich, Katz and Tao. By a result due to Kolountzakis, if a convex polytope Ω⊂Rd is spectral, then it must be centrally symmetric. We prove that also all the facets of Ω are centrally symmetric. These conditions are necessary for Ω to tile by translations. We also develop an approach which allows us to prove that in dimension d=3, any spectral convex polytope Ω indeed tiles by translations. Thus we obtain that Fuglede's conjecture is true for convex polytopes in R3.