The electronic Schr\"odinger equation describes fundamental properties of molecules and materials, but cannot be solved exactly for larger systems than the hydrogen atom. Quantum Monte Carlo is a suitable method when high-quality approximations are sought, and its accuracy is in principle limited only by the flexibility of the used wave-function ansatz. Here we develop a deep-learning wave-function ansatz, dubbed PauliNet, which has the Hartree-Fock solution built in as a baseline, incorporates the physics of valid wave functions, and is trained using variational quantum Monte Carlo (VMC). Our deep-learning method achieves higher accuracy than comparable state-of-the-art VMC ansatzes for atoms, diatomic molecules and a strongly-correlated hydrogen chain. We anticipate that this method can reveal new physical insights and provide guidance for the design of molecules and materials where highly accurate quantum-mechanical solutions are needed, such as in transition metals and other strongly correlated systems.