Energy spectrum and quantum Hall effect in twisted bilayer graphene